package com.luo.storage.model.domain;

import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import com.luo.storage.enums.UserStatus;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.time.LocalDateTime;
import java.util.List;

@Data
@NoArgsConstructor
@AllArgsConstructor
@TableName("user")
public class User {
    /**
     * 基本属性
     * 1)账号
     * 2)个人信息
     */
    private Long id;
    private Long userNum;
    private String username;
    private String password;
    private String name;
    private Integer gender;
    private String phone;


    /**
     * 数据库字段
     */
    @TableField(fill = FieldFill.INSERT)
    private String createBy;
    @TableField(fill = FieldFill.INSERT)
    private LocalDateTime createTime;
    @TableField(fill = FieldFill.INSERT_UPDATE)
    private String updateBy;
    @TableField(fill = FieldFill.INSERT_UPDATE)
    private LocalDateTime updateTime;

    /**
     * 角色
     */
    @TableField(exist = false)
    private List<Role> role;

    /**
     * 逻辑删除
     */
    private UserStatus status;
}
